When power is applied from a d.c. or a.c. power supply to a small gap formed between a tool electrode of an electric discharge machining apparatus and a conductive workpiece, simply known as a "gap", the resistance of dielectric fluid across the gap is reduced. Then, when the insulation properties of the dielectric fluid are broken down, electric discharge is generated and "on-time" begins. During a controlled on-time, discharge current flows through the gap resulting in vaporization or melting of the workpiece material. When the on-time is completed, application of power is suspended during a controlled "off-time" in order to restore the insulation properties of the dielectric fluid. Decrease in on-time, in other words reduction in energy for one electric discharge, is known to contribute to improvements in surface roughness.
U.S. Pat. No. 5,149,931 discloses a power supply device for electric discharge machining, for applying a high frequency a.c. voltage from an a.c. power source to a gap, under the condition that series resonance, known as "gap resonance" is caused to occur between an capacitance component across the gap and a distributed inductance of a power supply circuit. If this gap resonance is maintained, electric discharge can occur in the gap even with high frequency a.c. voltage of 7 MHz or more. A low energy electric discharge generated in this way enables a shiny finished surface of 0.2 (m.mu.Rmax or less. High frequency a.c. voltage of 7 MHz or more can cause electric discharge to be generated only when gap resonance is maintained. In order to maintain this gap resonance, the power supply device of U.S. Pat. No. 5,149,931 varies the frequency of the a.c. power source in response to variation in impedance of the gap. The resonant frequency F0 is expressed by the equation F0=1/2.multidot..pi..multidot.(LmCg).sup.1/2. Lm represents the distributed inductance of the wiring, and Cg represents capacitance between the workpiece and the tool electrode. However, if the resonant frequency F0 changes significantly due to changes in machining area, the surface roughness will vary. For example, in an extreme case, when a workpiece changing in thickness from 1 mm to 50 mm is machined using a wire electrode, the capacitance Cg is increased by 50 times and the resonant frequency F0 varies by about 1/7. In this case, the surface roughness is increased in proportion to increase in thickness of the workpiece. The length of a wire for transmitting power into the gap also differs depending on the type of electric discharge machine, which means that the distributed inductance LM, and hence the surface roughness of the workpiece, differ depending on the type of the machine.